package com.chixing.config;

import com.chixing.Interceptor.TokenInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new TokenInterceptor())
                .addPathPatterns("/getAllOrders/**") //我的订单
                .addPathPatterns("/spikeProduct/goConfirm") //立即抢购
                .addPathPatterns("/testPerson") //个人中心
                .addPathPatterns("/coupon/selectCoupon/**") //领取优惠券
                .addPathPatterns("/cart/**"); //购物车数据加载、加入购物车

    }
}
